From: Carlos Garnacho Date: Wed, 9 Aug 2023 09:47:28 +0000 (+0200) Subject: inputMethod: Check that there is an existing cursor location X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~337^2~1^2~19 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5e36a06835587ea823bdd7241a9062dc12a288ce;p=gnome-shell.git inputMethod: Check that there is an existing cursor location Commit 17d9ec5788fb made the input method call update() more eagerly, but also at times that it does not have a cursor position yet. Make it bail out correctly in that situation. Fixes: 17d9ec5788fb ("inputMethod: Keep Capabilite.FOCUS before context.focus_in/focus_out") Part-of: --- diff --git a/js/misc/inputMethod.js b/js/misc/inputMethod.js index d944c2978..9f1659758 100644 --- a/js/misc/inputMethod.js +++ b/js/misc/inputMethod.js @@ -380,9 +380,11 @@ export const InputMethod = GObject.registerClass({ return; this._updateCapabilities(); this._context.set_content_type(this._purpose, this._hints); - this._context.set_cursor_location( - this._cursorRect.x, this._cursorRect.y, - this._cursorRect.width, this._cursorRect.height); + if (this._cursorRect) { + this._context.set_cursor_location( + this._cursorRect.x, this._cursorRect.y, + this._cursorRect.width, this._cursorRect.height); + } this._emitRequestSurrounding(); } });